package com.symaster.pdfcompose.frame.component.menu;

import com.formdev.flatlaf.ui.FlatButtonUI;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.ButtonUI;

/**
 * @author yinmiao
 * @version 2023/12/10
 */
public class MenuItem extends JButton {

    private final int index;
    private TopMenu.Item item;

    public MenuItem(int index, String text) {
        super(text);
        this.index = index;
        setBorder(new EmptyBorder(0, 15, 0, 15));
        setUI((ButtonUI) FlatButtonUI.createUI(this));
    }

    public TopMenu.Item getItem() {
        return item;
    }

    public void setItem(TopMenu.Item item) {
        this.item = item;
    }

    public int getIndex() {
        return index;
    }
}
